#if !defined(AFX_REALTIMEDATASURFACE_H__83BB3C55_18DF_408E_B7F1_4610E0978C8F__INCLUDED_)
#define AFX_REALTIMEDATASURFACE_H__83BB3C55_18DF_408E_B7F1_4610E0978C8F__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// RealtimeDataSurface.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CRealtimeDataSurface window

#include "BaseSurface.h"

class RealtimeRecordManager;
struct RealtimeRecord;

class CRealtimeDataSurface : public CBaseSurface
{
// Construction
public:
	CRealtimeDataSurface(CBasePanel * pPanel);

// Attributes
protected:
  static int m_nGDIResCounter;
  static CFont * m_pFont;

  CListCtrl m_listctrl;
  CComboBox m_cbPenWidth;
  CComboBox m_cbTime;
  CComboBox m_cbRefreshCycle;
  UINT m_nIdTimer;
  CTime m_timeEnd;
  int m_nPenWidth;
  int m_nTime;
  int m_nRefreshCycle;
  bool m_bShowListCtrl;

// Operations
public:
  virtual bool Create(CWnd * pParentWnd);
  virtual void Paint(CDC& dc);
  virtual void UpdateDefinitionDisplay(BaseCoalMineUnit * pCoalMineUnit);
  virtual void UpdateDataDisplay(BaseCoalMineUnit * pCoalMineUnit, BaseMonitoringUnit * pMonitoringUnit);
  virtual void ApplyOptions(DWORD dwOptionPagesMask);

  void CreateGDIResource();
  void DestroyGDIResource();
  bool IsPointOnEjectionLabel(const CPoint& point) const;
  void GetHistogramRect(LPRECT lpRect) const;
  void GetRealtimeCurveRect(LPRECT lpRect) const;
  void GetEjectionLabelRect(LPRECT lpRect) const;
  UINT GetEjectionLabelId() const;
  void GetListCtrlRect(LPRECT lpRect) const;
  void InsertRecordsToListCtrl();
  void InsertRecordToListCtrl(CListCtrl& listctrl, RealtimeRecord * pRecord, BaseMonitoringUnit * pMonitoringUnit) const;
  RealtimeRecordManager * AppendRealtimeRecordManager() const;

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CRealtimeDataSurface)
	//}}AFX_VIRTUAL

// Implementation
public:
	virtual ~CRealtimeDataSurface();

	// Generated message map functions
protected:
	//{{AFX_MSG(CRealtimeDataSurface)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnTimer(UINT nIDEvent);
	//}}AFX_MSG
  afx_msg void OnPenWidthChanged();
  afx_msg void OnTimeChanged();
  afx_msg void OnRefreshCycleChanged();
	DECLARE_MESSAGE_MAP()
};

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_REALTIMEDATASURFACE_H__83BB3C55_18DF_408E_B7F1_4610E0978C8F__INCLUDED_)
